CC = g++
CFLAGS = -Wall -g $(shell pkg-config --cflags opencv4)
FFMPEG_HOME = /home/orangepi/ffmpeg
LDFLAGS = $(shell pkg-config --libs opencv4) -lasound -lfdk-aac -lturbojpeg -lpthread \
          -L$(FFMPEG_HOME)/libavcodec -L$(FFMPEG_HOME)/libavformat -L$(FFMPEG_HOME)/libavutil -L$(FFMPEG_HOME)/libswresample \
          -L$(FFMPEG_HOME)/libswscale -lavcodec -lavformat -lavutil -lswscale -lswresample
TARGET = test
SOURCES = main.cpp camera.cpp encode_h264_aac.cpp 
$(TARGET):$(SOURCES)
	-$(CC) $(CFLAGS) $^ -o $@ $(LDFLAGS)

clean:
	rm -f $(TARGET)